import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
	mode: "history", // history 模式去除地址栏 # 号
	routes: [
		// 一级路由，渲染到 App.vue 中的 <router-view />
		{
			// http://127.0.0.1:8080/#/login
			path: "/login",
			name: "登录",
			component: () => import("@/components/Login.vue"),
		},
		{
			path: "/register",
			name: "注册",
			component: () => import("@/components/Register.vue"),
		},
		
		{
			path:"/",
			component:() => import("@/components/Layout.vue"),
			redirect:"/Home",
			children:[
			{
				path: "/Home",
				name: "首页",
				component: () => import("@/components/module/Home.vue"),
			},
			{
				path: "/ProductDetail",
				name: "商品详情页",
				component: () => import("@/components/module/ProductDetail.vue"),
			},
			{
				path: "/Personal",
				name: "个人中心",
				component: () => import("@/components/module/Personal.vue"),
			},
			
			{
				path: "/UpdateProfile",
				name: "编辑资料",
				component: () => import("@/components/module/UpdateProfile.vue"),
			},
			
			{
				path: "/UpdatePwd",
				name: "修改密码",
				component: () => import("@/components/module/UpdatePwd.vue"),
			},
			
			{
				path: "/ShopCart",
				name: "购物车",
				component: () => import("@/components/module/ShopCart.vue"),
			},
			
			{
				path: "/Orders",
				name: "订单",
				component: () => import("@/components/module/Orders.vue"),
			},
			],
		},

	],
});